package com.platform.dao.mybatis;

import com.platform.dao.ResourcesDao;
import com.platform.dao.mybatis.mapper.TbSysResourcesMapper;
import com.platform.domain.TbSysResources;
import com.platform.domain.query.TbSysResourcesQuery;
import com.platform.domain.result.TbSysResourceRole;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: wangyanginfo
 * Date: 12-8-31
 * Time: 下午1:57
 * To change this template use File | Settings | File Templates.
 */
@Service("resourcesDao")
public class ResourcesDaoImpl implements ResourcesDao {

    @Resource
    private TbSysResourcesMapper tbSysResourcesMapper;

    /**
     * 根据条件查询符合条件的资源信息
     *
     * @param resources 资源信息查询条件对象
     * @return 资源信息列表
     * @throws Exception
     */
    @Override
    public List<TbSysResources> queryResources(TbSysResourcesQuery resources) throws Exception {
        return tbSysResourcesMapper.select(resources);
    }

    /**
     * 查询所有资源信息带角色ID
     *
     * @return 资源信息列表
     * @throws Exception
     */
    @Override
    public List<TbSysResourceRole> queryAll() throws Exception {
        return tbSysResourcesMapper.selectAll();
    }
}
